﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace MySystemMag.Models
{
    public class User
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int id { get; set; }
        /// <summary>
        /// 用户编号
        /// </summary>
        [StringLength(45)]
        public string UserID { get; set; }
        /// <summary>
        /// 用户名
        /// </summary>
        [StringLength(45)]
        public string UserName { get; set; }
        /// <summary>
        /// 登录名
        /// </summary>
        [StringLength(100)]
        public string LoginName { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [StringLength(45)]
        public string LoginPWD { get; set; }
        /// <summary>
        /// 性别
        /// </summary>
        [StringLength(45)]
        public string Sex { get; set; }

        [StringLength(145)]
        public string BZ { get; set; }

        [StringLength(45)]
        public string Status { get; set; }

        public DateTime? CreateDate { get; set; }

        [StringLength(45)]
        public string CreateName { get; set; }

        public DateTime? EditDate { get; set; }

        [StringLength(45)]
        public string EditName { get; set; }

        /// <summary>
        /// 对应的角色主键
        /// </summary>
        public int Role_id { get; set; }
        /// <summary>
        /// 对应角色
        /// </summary>
        [ForeignKey("Role_id")]
        public virtual Role Role { get; set; }
        /// <summary>
        /// 对应的部门主键
        /// </summary>
        public int Office_id { get; set; }
        /// <summary>
        /// 对应部门
        /// </summary>
        [ForeignKey("Office_id")]
        public virtual Office Office { get; set; }


    }
}
